{*include file="template/admin_head.htm"*}
<link rel="stylesheet" href="/public/js/chosen/chosen.css">
<link rel="stylesheet" href="/public/js/tageditor/jquery.tag-editor.css">
<script src="/public/js/tageditor/jquery.tag-editor.js"></script>
<script src="/public/js/jquery/jquery.colorpicker.js" type="text/javascript"></script>
<script src="/public/js/chosen/chosen.jquery.js" type="text/javascript"></script>
<script src="/public/js/jquery/jquery.cookie.js"></script>
  
<table id="containtable" cellspacing="0" cellpadding="0" class="{*$cf_controller*}">
    <tr>
        <td width="1979" valign="top" bgcolor="#FFFFFF">
            <div class="wrapper pr_8">
			{*if $cf_action=='add' || $cf_action=='edit'*}  
            
			<script type="text/javascript">
			 $(function(){			
				call_uploader('#goods_image_button','#goods_image','goods',{'show':'#goods_image_show'});				
				$("#act_form").submit(function(){					
					if($("#goods_title").val() == ''){
						my_alert('请输入商品标题','错误提示',"$('#goods_title').focus()");
						return false;										
					}	
					if($("#goods_expressfee_id").val() == ''){
						my_alert('请选择邮费模板','错误提示',"$('#goods_code').focus()");
						return false;										
					}	
					if($("#goods_brand_id").val() == ''){
						my_alert('请选择品牌','错误提示',"$('#goods_brand_id').focus()");
						return false;										
					}
					if($("#goods_cate_id").val() == ''){
						my_alert('请选择商品分类','错误提示',"$('#goods_cate_id').focus()");
						return false;										
					}					
					if($("#goods_color").val() == null){
						my_alert('请选择商品颜色','错误提示',"$('#goods_color').focus()");
						return false;										
					}
					if($("#goods_price").val() == ''){
						my_alert('请输入现价','错误提示',"$('#goods_price').focus()");
						return false;										
					}				
					
					
					if($("#goods_tags").val() == ''){
						my_alert('请输入标签','错误提示',"$('#goods_tags').focus()");
						return false;										
					}
					if($("#goods_description").val() == ''){
						my_alert('请输入简要描述','错误提示',"$('#goods_description').focus()");
						return false;										
					}
					if($("#goods_express_desc").val() == ''){
						my_alert('请输入寄送和退货','错误提示',"$('#goods_express_desc').focus()");
						return false;										
					}
					if($("input[name='goods_images[]']").val() == undefined){
						my_alert('请上传商品图片','错误提示',"$('#goods_image_button').focus()");						
						return false;										
					}					
											
					if($("#goods_content").val() == ''){
						my_alert('请填写商品描述','错误提示',"$('#goods_content').focus()");
						return false;										
					}					
					
		
					
				});
				
				var goods_index_value = "{*$row.goods_index_value*}";	
				if(goods_index_value){
					$("input[name='goods_index_photo']").each(function(){	
						if(goods_index_value == $(this).val()){					
							$(this).attr("checked", true);
						}		
					});
				}	
				
				
				
				$("#add_item").click(function(){
					var index_val =  $("#item_list").find('tr').size();				
					var html_str = '<tr align="center">';
                        html_str +='<td ><input name="item_title[]" type="text"  size="30" value="" /></td>';
                        html_str +='<td><input name="item_image[]" type="hidden" value="" size="6" /><span id="'+index_val+'"><a href="javascript:void(0)" class="addimage">添加</a></span></td>';
                        html_str +='<td><input name="item_price[]" type="text" value="" size="6" /></td>';
                        html_str +='<td><input name="item_original_price[]" type="text" value="" size="6" /></td>';
                      	html_str +='<td><input name="item_board_price[]" type="text" value="" size="6" /></td>';
                        html_str +='<td><a href="javascript:void(0)" class="del_item"><img src="public/images/admin/close.png" /></a></td>';
                        html_str +='</tr>';
					$("#item_list").append(html_str)
					
					
					 //$("#item_list").append($("#copy_info").html())
				});
				 $(".del_item").live("click",function(){
					 $(this).parent().parent().remove();
					  //get_all_fee_total();
				 });
				 
				 $("#add_surcharge").click(function(){
					 $("#surcharge_list").append($("#surcharge_info").html())
				});
				 $(".del_surcharge").live("click",function(){
					 $(this).parent().parent().remove();
					  //get_all_fee_total();
				 });
				 
				 				
				call_editor('#goods_content','full');
				$('#goods_tags').tagEditor({ initialTags: [{*$row['goods_tags']*}], placeholder: '请输入标签' });				
				
				load_province('cate',"{*$row['goods_cate_pid']*}","{*$row['goods_cate_id']*}");                
				$("#cate1").change(function(){                                   //更改分类
					change_province('cate',$(this).val());
				});
				
				call_uploader('#goods_index_image_button','#goods_index_image','nofix',{'show':'#goods_index_image_show'});
				{*if $row['goods_index_image']*}
				$("#goods_index_image_show").append(show_photo_div("#goods_index_image_button","#goods_index_image","{*$row['goods_index_image']*}","admin",false));
				{*/if*}
				
				$(document).on('click','.addimage',function(){
					var id = $(this).parent().prop("id");					
					var images_arr = new Array();　//创建一个数组									
					$("input[name='goods_images[]']").each(function(i){					
						images_arr[i] = $(this).val();																	
					});
					$.cookie('images', images_arr , { path: '/', expires: 10000 }); 																					
					my_iframe('{*$cf_module_path*}goods-act_chooseimage.htm?id='+id,'选择图片',300,400);	
				});
				
				$(document).on('click','.delimage',function(){
					var id = $(this).parent().prop("id");					
					$(this).parent().parent().find("input").val('');
					$(this).parent().html('<a href="javascript:void(0)" class="addimage">添加</a>');
						
				});	
		    });
			</script>
			
			<div class="content_panel_title">
				<div class="contentpanelleft"></div>
				<div class="contentpanelcenter">
					<span class="contentpanelcenter_font">新增/修改商品</span>
					<span><a class="edit at" href="{*$cf_self_page*}?dpt={*$cf_dpt*}">商品管理</a></span>
				</div>
				<div class="contentpanelrihgt"></div>
            </div>
			<div class="bq clearfix">
			<b><a href="javascript:void(0)" class="tapbt">基本信息</a></b>
			
			</div>

			
			<div class="content_table_center_style">
                    <div class="p8">

                        <form name="act_form" id="act_form" method="post" action="{*$cf_self_page*}">
                            <input name="id" id="id" type="hidden" value="{*$row['goods_id']*}" />
                            <input name="dpt" id="dpt" type="hidden" value="{*$cf_dpt*}" />
                            <input name="act" id="act" type="hidden" value="{*$cf_action*}" />
				

				<div class="tab-page" style="display: block;">	
				<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tbl tbl_nbr">
				<tbody>
					<tr>
					<td colspan="4" class="stitle">商品信息</td>
				    </tr>
				    <tr>
					<td width="9%" align="right">商品标题:</td>
					<td align="left"><input type="text" size="40" id="goods_name" name="goods_name" value="{*$row['goods_name']*}"  /></td>
				    <td align="right">邮费模板:</td>
                    <td>{*html_options id=goods_expressfee_id name=goods_expressfee_id options=$expressfee_ary  selected=$row['goods_expressfee_id']|default:''*}</td>
                    </tr>                    
				    <tr>
					<td align="right">品牌:</td>
					<td width="32%" align="left">{*html_options id=goods_brand_id name=goods_brand_id options=$brand_ary  selected=$row['goods_brand_id']|default:''*}</td>
					<td width="11%" align="right">分类:</td>
					<td width="48%" align="left">
                       <select name="goods_cate_pid" id="cate1">
                            <option value='' selected="selected">请选择分类</option>
                            
                        </select>

                        <select name="goods_cate_id" id="cate2" disabled="disabled" style="display:none">
                            <option value='' selected="selected">请选择子分类</option>

                        </select>
                    </td>
				    </tr>
                     <tr>
					<td width="9%" align="right">颜色:</td>
					<td align="left">
                    	<select name="goods_color[]" id="goods_color" data-placeholder="请选择颜色" class="chosen-select" multiple style="width:350px;" >
                        	{*foreach $color_ary as $k=>$v*}
                            {*if $k == $row['selected_color'][$k] && $k*}
                            <option value="{*$k*}" selected >{*$v*}</option>
                            {*else*}
                            <option value="{*$k*}" >{*$v*}</option>
                            {*/if*}
                            {*/foreach*}                                                 
                          </select>
                    </td>
                    <td width="11%" align="right">重量:</td>
                    <td width="48%" align="left"><input id="goods_weight" name="goods_weight" size="8" type="text" value="{*$row['goods_weight']*}" />KG   <span class="red">（适用于邮费的按重量的商品）</span></td>
				    </tr>               
                    
                   <tr>
                    <td align="right">现价:</td>
                    <td width="32%" align="left">￥<input id="goods_price" name="goods_price" type="text" size="8" value="{*$row['goods_price']*}" /> 元</td>
                    <td width="11%" align="right">原价:</td>
                    <td width="48%" align="left">￥<input id="goods_original_price" name="goods_original_price" size="8" type="text" value="{*$row['goods_original_price']*}" /> 元</td>
                    </tr>
                     <tr>
					<td align="right">类型和价格:</td>
						<td colspan="3">
                        	<table width="65%" id="item_list">
                              <tr bgcolor="#F2F2F2">
                                <th width="29%" height="25" scope="col">类型</th>
                                <th width="16%" scope="col">图片</th>
                                <th width="18%" scope="col">现价</th>
                                <th width="13%" scope="col">原价</th>
                                <th width="16%" scope="col">搭伙价</th>
                                <th width="8%" scope="col">操作</th>
                              </tr>
                              {*foreach $row['goods_property_item'] as $k=>$item*}
                              {*$id = $k+1*}
                              <tr align="center">
                                <td><input name="item_title[]" type="text"  size="30" value="{*$item.title*}" /></td>
                                <td><input name="item_image[]" type="hidden" value="{*$item['image']*}" size="6" id="image{*$id*}" /><span id="{*$id*}">
                                {*if $item['image']*}
                                <img src="{*$item['image']*}" width="100" height="60" /><br>
								<a href="javascript:void(0)" class="delimage">删除</a>
                                {*else*}
                                <a href="javascript:void(0)" class="addimage">添加</a>
								</span>
                                {*/if*}
                                </td>
                                <td><input name="item_price[]" type="text" value="{*$item['price']*}" size="6" /></td>
                                <td><input name="item_original_price[]" type="text" value="{*$item['original_price']*}" size="6" /></td>
                                <td><input name="item_board_price[]" type="text" value="{*$item['board_price']*}" size="6" /></td>
                                <td><a href="javascript:void(0)" class="del_item"><img src="public/images/admin/close.png" /></a></td>
                              </tr>
                              {*/foreach*}                              
                            </table>
                            <div class="item_all_total"><b><a href="javascript:void(0)" id="add_item"><img src="public/images/admin/add.png" /></a></b></span></div>
                       </td>
					</tr>
                    <tr>
					<td align="right">附加收费项:</td>
						<td colspan="3"><div class="item_part">
                    <ul id="surcharge_list">
                        <li>
                          <p>
                          <span class="span1" style="width:200px">附加收费项目名称</span>
                          <span class="span1">费用</span>
                          <span class="span1" style="width:200px">免除附加费所需购买的商品数量</span>
                          <span>操作</span>
                          </p></li>
                          
                        {*foreach $row['goods_surcharge_item'] as $item*}
                        <li>
						<span class="span1" style="width:200px"><input name="surcharge_title[]" type="text"  size="30" value="{*$item.title*}" /></span>
                        <span class="span1"><input name="surcharge_price[]" type="text" value="{*$item.price*}" size="8" /></span>
                        <span class="span1" style="width:200px"><input name="surcharge_free_number[]" type="text" value="{*$item.free_number*}" size="8" /></span>
						<span><a href="javascript:void(0)" class="del_surcharge"><img src="public/images/admin/close.png" /></a></span>
						</li>
                        {*/foreach*}
						
						
                    </ul>
                    <div class="item_all_total"><b><a href="javascript:void(0)" id="add_surcharge"><img src="public/images/admin/add.png" /></a></b></span>
                    </div>
                </div></td>
					</tr> 
                    
                    <tr>
					 	<td align="right">标签:</td>
					 	<td colspan="3" align="left"><input type="text" id="goods_tags" name="goods_tags"/></td>
				 	</tr>
                    <tr>
					<td width="9%" align="right">简要描述:</td>
					<td align="left"><textarea id="goods_description" name="goods_description" cols="50" rows="8">{*$row['goods_description']*}</textarea></td>
				    <td align="right">寄送和退货:</td>
                    <td><textarea id="goods_express_desc" name="goods_express_desc" cols="50" rows="8">{*$row['goods_express_desc']*}</textarea></td>
                    </tr>  
                     <tr>
						<td align="right">商品封面封面图:</td>
						<td colspan="3" ><span id='goods_index_image_show'><img style="cursor:pointer" id="goods_index_image_button" src="/public/images/admin/upload.jpg" /></span>
							<input type="hidden" name="goods_index_image" id="goods_index_image" value="{*$row['goods_index_image']*}" /></td>
						
					</tr> 
                                      
                  <tr>
					 	<td align="right">商品图片:</td>
					 	<td colspan="3" align="left"><span id='goods_image_button'><img style="cursor:pointer" id="goods_image" src="/public/images/admin/upload.jpg"  /></span>
                        <table width="50%" id="goods_image_show">
                          <tr bgcolor="#F2F2F2">
                            <td width="43%" align="center"><b>图片</b></td>
                            <td width="30%" align="center"><b>操作</b></td>
                          </tr>
                          {*foreach $row['goods_images'] as $v*}
                          <tr>
                          	<td align="center"><a href="{*$v*}" target="_blank" title="点击查看大图"><img height="80" src="{*$v*}"></a></td>
                            <td align="center"><a href="javascript:void(0)" class="red" onclick="del_photo_tr($(this))"><img src="public/images/admin/close.png">
                            </a><input type="hidden" name=goods_images[] value="{*$v*}" ></td>
                           </tr>
                          {*/foreach*}                          
                      
                          
                        </table>
                        						
   				      </td>
				 	</tr>
                     <tr>
					<td align="right">详细内容:</td>
					<td colspan="3" align="left">
					    <textarea name="goods_content" id="goods_content" style="width:800px;height:500px;">{*$row.goods_content*}</textarea></td>
				    </tr>                    
                    <tr>
					<td align="right">标识设置:</td>
					<td colspan="3" align="left">
                        <table width="100%">
                            <tr>
                            	<td width="14%" align="right">是否有赠品：</td>
                              <td width="10%" align="left">{*html_radios name=goods_is_present options=$cf_info_var_common['yesno'] checked=$row['goods_is_present']|default:'0'*}</td>
                              <td width="12%" align="right">是否包邮：</td>
                              <td width="11%" align="left">{*html_radios name=goods_is_expressfee options=$cf_info_var_common['yesno'] checked=$row['goods_is_expressfee']|default:'0'*}</td>
                              <td width="15%" align="right">是否24小时发货：</td>
                                <td width="38%" align="left">{*html_radios name=goods_is_24hours options=$cf_info_var_common['yesno'] checked=$row['goods_is_24hours']|default:'0'*}</td>
                                
                            </tr>
                            <tr>
                            	<td align="right">是否绿色环保：</td>
                              <td align="left">{*html_radios name=goods_is_green options=$cf_info_var_common['yesno'] checked=$row['goods_is_green']|default:'0'*}</td>
                              <td align="right">是否手工制作：</td>
                              <td align="left">{*html_radios name=goods_is_hand options=$cf_info_var_common['yesno'] checked=$row['goods_is_hand']|default:'0'*}</td>
                              <td align="right">是否7天无条件退换：</td>
                                <td align="left">{*html_radios name=goods_is_7exchange options=$cf_info_var_common['yesno'] checked=$row['goods_is_7exchange']|default:'0'*}</td>
                                
                            </tr>
                        </table>              
                    
                    
                    
                    
                   </td>
				    </tr>
                    <tr>
                        <td align="right">状态:</td>
                        <td align="left">{*html_radios name=goods_status options=$cf_info_var_common['goods_status'] checked=$row['goods_status']|default:'1'*}</td>
                        <td width="11%" align="right">推荐位置:</td>
						<td width="48%">{*html_radios name=goods_recommend options=$cf_info_var_common['goods_recommend'] checked=$row['goods_recommend']|default:'0'*}</td>
					</tr>
                    <tr>
					<td align="right">是否推荐到首页:</td>
					<td colspan="3" align="left">{*html_radios name=goods_is_index options=$cf_info_var_common['yesno'] checked=$row['goods_is_index']|default:'0'*}</td>
				    </tr>
                   <tr>
					<td align="right">搭伙购设置:</td>
					<td colspan="3" align="left">
                        <table width="100%">
                            <tr>
                            	<td width="14%" align="right">是否参加搭伙购：</td>
                              <td width="8%" align="left">{*html_radios name=goods_is_board options=$cf_info_var_common['yesno'] checked=$row['goods_is_board']|default:'0'*}</td>
                              <td width="15%" align="right">达成搭伙购的人数：</td>
                              <td width="7%" align="left"><input name="goods_board_least_number" id="goods_board_least_number" type="text" value="{*$row['goods_board_least_number']*}" size="6"/></td>
                              <td width="11%" align="right">搭伙天数：</td>
                                <td width="45%" align="left"><input name="goods_board_days" type="text" id="goods_board_days" value="{*$row['goods_board_days']*}" size="6" />
					                              
                                </td>
                                
                            </tr>
                            <tr>
                            	<td width="14%" align="right">搭伙价：</td>
                              <td width="8%" align="left"><input name="goods_board_price" id="goods_board_price" type="text" value="{*$row['goods_board_price']*}" size="6"/></td>
                              <td width="15%" align="right">是否允许单卖：</td>
                              <td width="7%" align="left">{*html_radios name=goods_board_sold options=$cf_info_var_common['yesno'] checked=$row['goods_board_sold']|default:'1'*}</td>
                              <td width="11%" align="right">拉王奖励</td>
                              <td width="45%" align="left"><input name="goods_board_reward" id="goods_board_reward" type="text" value="{*$row['goods_board_reward']*}" size="30"/></td>
                            </tr>               
                        </table> 
                    
                   </td>
				    </tr>
                    <tr>
                        <td align="right">限购数量:</td>
                        <td align="left"><input name="goods_buy_limit" id="goods_buy_limit" value="{*$row['goods_buy_limit']|default:0*}" size="3" /> <span class="red">（0代表不限购）</span></td>
                        <td width="11%" align="right">库存数:</td>
						<td width="48%"><input name="goods_stock" id="goods_stock" value="{*$row['goods_stock']|default:1000*}"  /></td>
					</tr>
                    
                  </tbody>
			    </table>
				</div>
				
			
				
				
				<script type="text/javascript">
				var config = {
				  '.chosen-select'           : {},
				  '.chosen-select-deselect'  : {allow_single_deselect:true},
				  '.chosen-select-no-single' : {disable_search_threshold:10},
				  '.chosen-select-no-results': {no_results_text:'Oops, nothing found!'},
				  '.chosen-select-width'     : {width:"95%"}
				}
				for (var selector in config) {
				  $(selector).chosen(config[selector]);
				}
			  </script>
				<div class="pt_8" align="center"><input type="submit" name="Submit" value="提 交" class="myinput" />
                 &nbsp;&nbsp;<input type="button" name="back" value="返 回" onclick="window.history.back()" class="myinput" /></div>
                     </form>
                    </div>
                </div>
				
                <div class="tab-page" style="display:block" >
                    <div style="display:none"> 
                        <ul id="copy_info">
                            <li>
                                <span class="span1" style="width:200px"><input name="item_title[]" type="text" size="30"  /></span>
                                <span class="span1"><input name="item_price[]" type="text" size="6" /></span>
                                <span class="span1"><input name="item_original_price[]" type="text" size="6" /></span>
                                <span class="span1"><input name="item_board_price[]" type="text" value="{*$item['board_price']*}" size="6" /></span>
                                <span><a href="javascript:void(0)" class="del_item"><img src="public/images/admin/close.png" /></a></span>
                            </li>
                        </ul>
                        
                        <ul id="surcharge_info">
                            <li>
                                <span class="span1" style="width:200px"><input name="surcharge_title[]" type="text" size="30"  /></span>
                                <span class="span1"><input name="surcharge_price[]" type="text" size="8" /></span>
                                <span class="span1" style="width:200px"><input name="surcharge_free_number[]" type="text" size="8" /></span>
                                <span><a href="javascript:void(0)" class="del_surcharge"><img src="public/images/admin/close.png" /></a></span>
                            </li>
                        </ul>
                    </div>
                </div>                
                
				<div class="content_main_bottom">
                    <div class="content_main_bottom_left"></div>
                    <div class="content_main_bottom_right"></div>
                </div>
			{*elseif $cf_action=='detail'*}
			<div class="content_panel_title">
				<div class="contentpanelleft"></div>
				<div class="contentpanelcenter">
					<span class="contentpanelcenter_font">商品详情</span>
					<span><a class="edit at" href="{*$cf_self_page*}?dpt={*$cf_dpt*}">商品管理</a></span></div>
				<div class="contentpanelrihgt"></div>
            </div>
			
			<div class="content_table_center_style">
                    <div class="p8">
						<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tbl tbl_nbr">
							    <tbody>
							    </tbody>
							    <tbody>
								<tr>
								    <td colspan="4" class="stitle">商品信息&nbsp;&nbsp;<a style="" href="/admin/goods.htm?dpt={*$dpt*}&act=edit&id={*$row['goods_id']*}"  class="blue">修改信息</a></td>
								</tr>
								<tr>
								    <td width="12%" align="right">商品标题:</td>
								    <td width="38%" align="left">{*$row['goods_title']*}</td>
								    <td width="12%"align="right">商品分类:</td>
								    <td width="38%" align="left">{*$row['cate']*}</td>
								</tr>
								<tr>
									<td align="right">商品简介:</td>
									<td width="38%" align="left">{*$row['goods_introduction']*}</td>
									<td width="12%"align="right">商品编码:</td>
								    <td width="38%" align="left">{*$row['goods_code']*}</td>
									</tr>
								<tr>
								    <td height="69" align="right">商品图片:</td>
								    <td colspan="3" align="left"><img src="{*$row['goods_index_photo']*}" height="80" border="0" />
								    </td>
								</tr>
								
								<tr>
									<td align="right">附加图片:</td>
									<td colspan="3" align="left">{*$row['img']*}</td>
								</tr>
								<tr>
								    <td align="right">商品描述:</td>
								    <td colspan="3" align="left">{*$row['goods_content']*}</td>
								</tr>
								<tr>
								    <td colspan="4" class="stitle">价格信息</td>
								</tr>
								<tr>
								    <td align="right">现价:</td>
								    <td align="left">{*$row['goods_price']*}</td>
								    <td align="right">原价:</td>
								    <td align="left">{*$row['goods_original_price']*}</td>
								</tr>
								<tr>
									<td colspan="4" class="stitle">基本属性</td>
									</tr>
									
									{*foreach $row['options'] as $k=>$v*}
									{*$key='option'|cat:$k*}
									<tr>
										<td align="right">属性{*$k*}:</td>
										<td colspan="3"><input name="{*$key*}" type="text" size="10" value="{*$v['title']*}" disabled="disabled" />
										&nbsp;&nbsp;&nbsp;数值:
										{*foreach $v['option'] as $kk=>$vv*}
										<input name="{*$key*}_value[]" type="text" size="8" value="{*$vv*}" disabled="disabled" />&nbsp;
										{*/foreach*}</td>
									</tr>
									{*/foreach*}
								<tr>
								    <td colspan="4" class="stitle">套餐搭配</td>
								</tr>
								<tr>
								    <td align="right">套餐搭配:</td>
								    <td colspan="3" align="left">
									<div class="item_part">
                    				<ul id="item_list">
                       				 <li><p>
									  <span class="span1" style="width:60%;">内容说明</span>
									  <span class="span1">价格</span>
									  </p></li>
									  {*foreach $row['package'] as $item*}
									  <li><span class="span1" style="width:60%;text-align:left;">{*$item['title']*}</span><span class="span1">{*$item['price']*}</span></li>
									  {*/foreach*}
									  
									</ul>
									</div>
									
									</td>
								    </tr>
								
								<tr>
								    <td colspan="4" class="stitle">推荐与特价</td>
								</tr>
								<tr>
								    <td align="right">是否推荐:</td>
								    <td align="left">{*$cf_info_var_common['yesno'][$row['goods_ishot']]*}</td>
								    <td align="right">是否特价:</td>
								    <td align="left">{*$cf_info_var_common['yesno'][$row['goods_isspecial']]*}</td>
								</tr>
								<tr>
								    <td colspan="4" class="stitle">其它信息</td>
								</tr>
								<tr>
								    <td align="right">状态:</td>
								    <td align="left">{*$cf_info_var_common['goods_status'][$row['goods_status']]*}</td>
								    <td align="right">创建时间</td>
								    <td align="left">{*$row['goods_create_time']*}</td>
								</tr>
								<tr>
								    <td align="right">修改时间:</td>
								    <td align="left">{*$row['goods_edit_time']*}</td>
								    <td align="right">创建者:</td>
								    <td align="left">{*$row['goods_create_user']*}</td>
								</tr>
							    <tr>
								    <td align="right">销量:</td>
								    <td  colspan="3"  align="left">{*$row['goods_sales']*}</td>
								</tr>
							    </tbody>
						</table>

                        
                    </div>
                </div>
				
			<div class="content_main_bottom">
				<div class="content_main_bottom_left"></div>
				<div class="content_main_bottom_right"></div>
		    </div>
			
			{*else*}
			<script type="text/javascript">
			
			$(function(){
				load_province('cate',"{*$cate1*}","{*$cate2*}");
				$("#cate1").change(function(){                                   //更改分类
					change_province('cate',$(this).val());
				});
				
				$("#checkall").toggle(
                    function(){
                        select_all("idlist[]",true);
                    },
                    function(){
                        select_all("idlist[]",false);
                    }
                );
				
				$("#list_form").submit(function(){
					if(!count_select("idlist[]")){
						my_alert('请选择记录','操作提示');
						return false;
					};
					if($("#alltype").val()==''){
						my_alert('请选择操作方式','Error',"$('#alltype').focus()");
						return false;
					};
					if(confirm('确定进行操作?')==false){
						return false;
					}
					return true;
                });				
			})
			</script>
			
			<div class="pannel">
				<div class="pl"></div>
				<div class="pr"></div>
				<div class="pc">
					<form action="" method="get" id="search_form" name="search_form">
					<input name="dpt" id="dpt" type="hidden" value="{*$cf_dpt*}" />
					<input name="self" id="dpt" type="hidden" value="{*$self*}" />
					<div class="pt">
						商品标题:
						<input type="text" size="20" id="skey" name="skey" class="tet" value="{*$skey*}" />	
						&nbsp;&nbsp;分类:
						  <select name="cate1" id="cate1">
                            <option value='' selected="selected">请选择分类</option>
                            
                        </select>

                        <select name="cate2" id="cate2" disabled="disabled" style="display:none">
                            <option value='' selected="selected">请选择子分类</option>

                        </select>						
						&nbsp;&nbsp;创建时间:
					<input name="start" class="Wdate" type="text" id="act_start" value="{*$start*}" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'act_end\')}',dateFmt:'yyyy-MM-dd',isShowClear:true,readOnly:true});" size="12" maxlength="30" />
					到<input name="end" class="Wdate" type="text" id="act_end" value="{*$end*}" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'act_start\')}',dateFmt:'yyyy-MM-dd',isShowClear:true,readOnly:true});" size="12" maxlength="30" />
					 &nbsp;			   
					  <input type="image" src="public/images/admin/icon_search_btn.gif" />
					</div>
					</form>
				</div>
		    </div>
			
			<div class="content_panel_title">
				<div class="contentpanelleft"></div>
				<div class="contentpanelcenter">
					<span class="contentpanelcenter_font">商品管理</span>
					<span><a class="edit at" href="{*$cf_self_path*}-act_add.htm?dpt={*$cf_dpt*}">添加商品</a></span>&nbsp;
				</div>
				<div class="contentpanelrihgt"></div>
		    </div>
			
			<div class="content_table_center_style">
			<div class="p8">
			    <div class="bq clearfix">
				<b><a href="{*$cf_self_path*}-act_index.htm?dpt={*$cf_dpt*}" class="{*if $self==''*}active{*/if*}">所 有 </a></b>
				{*foreach $cf_info_var_common['goods_status'] as $k=>$item*}
				{*if $k==$self && $self!=''*}
				{*assign var=class value='active'*}
				{*else*}
				{*assign var=class value=''*}
				{*/if*}
				<b><a href="{*$cf_self_path*}-act_index.htm?dpt={*$cf_dpt*}&self={*$k*}" class="{*$class*}" >{*$item*}</a></b>
				{*/foreach*}
			    </div>
			    <form name="list_form" id="list_form" method="post" action="{*$cf_self_page*}">
				<input name="act" type="hidden" value="all" />
				<input name="dpt" type="hidden" value="{*$cf_dpt*}" />
				<table width="100%" class="tbl tbl_nbr">
				    <thead>
					<tr class="thd">
					  <td width="3%" align="center" class="thr">选择</td>
					    <td width="4%" align="center" class="thr">ID</td>
					    <td width="13%" align="center" class="thr">商品标题</td>
					    <td width="9%" align="center" class="thr">封面图</td>
					    <td width="8%" align="center" class="thr">品牌</td>
					    <td width="18%" align="center" class="thr">分类</td>
					    <td width="8%" align="center" class="thr">现价</td>
					    <td width="7%" align="center" class="thr">库存</td>
					    <td width="5%" align="center" class="thr">状态</td>
					    <td width="11%" align="center" class="thr">创建时间</td>
					    <td colspan="3" align="center" class="thr">操作</td>
					</tr>
				    </thead>
				    <tbody>
					{*foreach $data_ary as $item*}
					<tr onmouseout="this.style.backgroundColor='#ffF'" onmouseover="this.style.backgroundColor='#ffC'">
					  <td align="center"><input type="checkbox" name="idlist[]" value="{*$item['goods_id']*}" style="height:15px;" /></td>
					    <td align="center">{*$item['goods_id']*}</td>
					    <td align="left"><a href="/default/goods-act_detail_id_{*$item['goods_id']*}.htm" title="查看詳情" class="edit" target="_blank">{*$item['goods_name']*}</a></td>
					    <td align="center"><a href="{*$item['goods_index_image']*}" target="_blank" ><img src="{*$item['goods_index_image']*}" height="50px" /></a></td>
					    <td align="center">{*$brand_ary[$item['goods_brand_id']]*}</td>
					    <td align="center">{*$item['cate_title']*}</td>
					    <td align="center">￥{*$item['goods_price']*}</td>
					    <td align="center">{*$item['goods_stock']*}</td>
					    <td align="center">{*$cf_info_var_common['goods_status'][$item['goods_status']]*}</td>
					    <td align="center">{*$item['goods_create_time']*}</td>
					    <td width="4%" align="center"><a href="{*$cf_self_path*}-act_edit_id_{*$item['goods_id']*}.htm?dpt={*$cf_dpt*}" class="edit">修改</a></td>
					    <td width="5%" align="center"><a href="{*$cf_self_path*}-act_copy_id_{*$item['goods_id']*}.htm" class="edit" onclick="return confirm('你确定要复制吗?')">复制</a></td>
                        <td width="5%" align="center"><a href="{*$cf_self_path*}-act_del_id_{*$item['goods_id']*}.htm" class="del" onclick="return confirm('你确定要删除吗?')">删除</a></td>
					    
                      </tr>
					{*/foreach*}
					<tr class="tft">
					    <td colspan="13" style="padding:0;">
						<table width="100%" border="0">
						    <tr>
                                                    <td width="6%" align="center" style="border:0;padding:0;"><input type="button" name="checkall" id="checkall" class="myinput" value="全 选" /></td>
                                                    <td width="22%" align="center" style="border:0;padding:0;">
                                                    <select name="alltype" id="alltype">
                                                            <option selected="selected" value="">操作选择</option>
                                                            <option value="allhome">列表首页显示</option>
                                                            <option value="cancelallhome">取消列表首页显示</option>                                                              
                                                            <!--<option value="alldel">删除</option>-->
                                                        </select>
                                                        &nbsp;<input type="submit" name="submit_all" id="submit_all" value="批量操作" class="myinput" /></td>
                                                    <td width="72%" style="border:0;padding:0;" ><div class="turnPage"><p>{*$page*}</p></div></td>
                                                </tr>
						</table>                                </td>
					</tr>
				    </tbody>
				</table>
			    </form>
			</div>
		    </div>
			
			<div class="content_main_bottom">
				<div class="content_main_bottom_left"></div>
				<div class="content_main_bottom_right"></div>
		    </div>			

		    {*/if*}
			</div>
		</td>
    </tr>
</table>
{*include file="template/admin_foot.htm"*}